package com.trainoo.mina.filter;

import org.apache.mina.core.filterchain.IoFilterAdapter;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Auther: zt
 * @Date: 2020/4/14 14:32
 * @Description:
 */
public class MyFirstServerFilter extends IoFilterAdapter {

    private static final Logger LOG = LoggerFactory.getLogger(MyFirstServerFilter.class);

    @Override
    public void messageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
        // 1.处理本filter需要做的事
        LOG.debug("this is my first filter");



        // 2.交给下一个filter
        nextFilter.messageReceived(session, message);
    }
}
